/**
 * 算法就是从输入输出之间找规律 动态输入
 * n = 1 [ '0', '1']
 * n = 2 [ '00', '01', '11', '10' ]
 * n = 3 [ '000', '001', '011', '010', '110', '111', '101', '100' ]
 */
let n = 3
let make = (n) => {
  if (n == 1) {
    return ['0', '1']
  } else {
    let prev = make(n-1)
    let result = []
    let max = Math.pow(2, n) - 1
    for(let i = 0, len = prev.length; i<len; i++){
      result[i] = `0${prev[i]}`
      result[max-i] = `1${prev[i]}`
    }
    return result
  }
}
console.log(make(n))